﻿using Padsurface.App.Services.Interfaces;
using Padsurface.App.Tests.Unit.Stubs;
using Padsurface.App.ViewModels;
using Padsurface.Audio.Engine.Interfaces;
using Padsurface.Audio.Song.Services.Interfaces;
using Padsurface.Audio.Wave;
using Padsurface.CoreAudio.Wrappers.Services.Interfaces;
using Padsurface.Tests;

namespace Padsurface.App.Tests.Unit.ViewModels.PadViewModelSpecifications
{
    public abstract class PadViewModelTestBase : TestBase
    {
        protected PadViewModel ViewModel { get; private set; }
        protected IFilePicker FilePicker { get; private set; }
        protected WaveFileInput WaveFileInput { get; private set; }
        protected IAudioClientActivator AudioClientActivator { get; private set; }
        protected IAudioCaptureClientActivator AudioCaptureClientActivator { get; private set; }
        protected IMetronome Metronome { get; private set; }
        protected IPlayBuffer PlayBuffer { get; private set; }
        protected ISongSaver SongSaver { get; private set; }

        protected override void Arrange()
        {
            FilePicker = new FilePickerStub();

            AudioClientActivator = new AudioClientActivatorStub();
            AudioCaptureClientActivator = new AudioCaptureClientActivatorStub();
            WaveFileInput = new WaveFileInput(AudioClientActivator, AudioCaptureClientActivator);
            Metronome = new Padsurface.Audio.Engine.Metronome();
            SongSaver = new SongSaverStub();

            ViewModel = new PadViewModel(Metronome, PlayBuffer, FilePicker, WaveFileInput, SongSaver);
        }
    }
}
